Location

interface Location

Represents geographical location information.

This interface provides access to both postal address components (like street, city, country) and precise geographic coordinates (latitude, longitude). It may also include specific location identifiers like the National Weather Service (NWS) Zone ID.

Location objects are typically associated with Device instances to specify their physical placement, or used to configure location-based services such as weather forecasts or targeted content.

See also

// Example of usage

Functions

Link copied to clipboard
abstract fun getAddress1(): String
Gets the first line of the street address.
Link copied to clipboard
abstract fun getAddress2(): String
Gets the second line of the street address.
Link copied to clipboard
abstract fun getCity(): String
Gets the city name.
Link copied to clipboard
abstract fun getCountry(): String
Gets the country name or code.
Link copied to clipboard
abstract fun getCounty(): String
Gets the county or administrative division (if applicable for the country).
Link copied to clipboard
abstract fun getLatitude(): Double
Gets the geographic latitude of the location in decimal degrees.
Link copied to clipboard
abstract fun getLongitude(): Double
Gets the geographic longitude of the location in decimal degrees.
Link copied to clipboard
abstract fun getNwsZoneId(): String
Gets the National Weather Service (NWS) Zone ID for this location.
Link copied to clipboard
abstract fun getPostalCode(): String
Gets the postal code or ZIP code.
Link copied to clipboard
abstract fun getState(): String
Gets the state, province, or region.